<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<link href="../css/style_wln.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../js/calendar.js"></script>
<script type="text/javascript">
    Date.prototype.Format = function (fmt) { //author: meizz
        var o = {
            "M+": this.getMonth() + 1, //月份
            "d+": this.getDate(), //日
            "h+": this.getHours(), //小时
            "m+": this.getMinutes(), //分
            "s+": this.getSeconds(), //秒
            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
            "S": this.getMilliseconds() //毫秒
        };
        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    }

    function init(){
        //先声明一个异步请求对象
        var xmlHttpReg = null;
        if (window.ActiveXObject) {//如果是IE
            xmlHttpReg = new ActiveXObject("Microsoft.XMLHTTP");
        } else if (window.XMLHttpRequest) {
            xmlHttpReg = new XMLHttpRequest(); //实例化一个xmlHttpReg
        }

        //如果实例化成功,就调用open()方法,就开始准备向服务器发送请求
        if (xmlHttpReg != null) {
            xmlHttpReg.open("get", "../behind_manage/wln.php", true);
            xmlHttpReg.send(null);
            xmlHttpReg.onreadystatechange = doCallBack; //设置回调函数
        }

        function doCallBack(){
            if(xmlHttpReg.readyState == 4){
                if (xmlHttpReg.status == 200) {//200代表执行成功
                    //将xmlHttpReg.responseText的值赋给ID为resText的元素
                    //document.getElementById("resText").innerHTML = xmlHttpReg.responseText;
                    var result = xmlHttpReg.responseText;
//                    alert(result);
                    eval("var json= " + result);
                    document.getElementById('curdt').innerHTML = json['curdt'];
                    document.getElementById('yi_list').innerHTML = json['yi_list'];
                    document.getElementById('ji_list').innerHTML = json['ji_list'];

                    var temp = new Date();
                    var nl_data = calendar.solar2lunar(temp.getFullYear(),temp.getMonth()+1,temp.getDate());
                    var ml = nl_data.IMonthCn;
                    var nl = nl_data.IDayCn;
                    document.getElementById('curndt').innerHTML = ml+nl;
                }
            }
        }
    }

    function jiemei_content(){
        var jiemeng_content = document.getElementById("jiemeng_content");
        if(jiemeng_content.value=="简述你的梦境.."){
            alert("请输入正确内容!!!");
        }else{
            window.location.href='jiemeng_content.html?query='+jiemeng_content.value;
        }
    }

</script>
<body id="body" onload="init();">
    <div class="jiemeng_area">
        <div class="label1">
            <img src="../logo/01_zgjm.png" width="80%" height="150px;">
        </div>
        <div id="search_line" class="search_line">
            <input type="text" value="简述你的梦境.." id="jiemeng_content" onfocus="this.value=''" onblur="if(this.value==''){this.value='简述你的梦境..'}" />
            <p onclick="jiemei_content()" class="color_transparent">点击</p>
        </div>
    </div>

    <div class="date_area" >
        <div class="text_center">
            <div class="hor_line_half"style="width: 18%;margin-bottom: 35px;"></div>
            <p class="cur_date display_inline_block color_red" id="curdt">12月16日</p>
            <div class="hor_line_half" style="width: 18%;margin-bottom: 35px;"></div>
        </div>
        <p class="cur_date_n color_red" id="curndt">十一月初四</p>
        <p class="cur_weather color_glod" id="cur_w">晴转多云，东北风5至6级，多穿衣服</p>
        <div class="cur_date_yj_area red_write">
            <div class="cur_date_yj">
                <p>宜</p>
                <p id="yi_list">嫁娶  吃饭  开光  吃饭</p>
            </div>
            <div class="cur_date_yj">
                <p>忌</p>
                <p id="ji_list">嫁娶  吃饭  开光  吃饭</p>
            </div>
        </div>
    </div>

    <p class="zr_title color_red">快速择日</p>

    <div class="zr_area">
        <a href="wln_zr.html?type=jq"><div class="border_red color_red">嫁娶，吃饭</div></a>
        <a href="wln_zr.html?type=jq"><div class="border_red color_red">嫁娶，吃饭</div></a>
    </div>
    <div class="zr_area">
        <a href="wln_zr.html?type=jq"><div class="border_red color_red">嫁娶，吃饭</div></a>
        <a href="wln_zr.html?type=jq"><div class="border_red color_red">嫁娶，吃饭</div></a>
    </div>
    <a href="wln_lhl.html">
        <p class="all_zr color_red">完整日历>></p>
    </a>
    <div class="spr_line_half">
        <div></div>
        <p>解梦万历年</p>
        <div></div>
    </div>
</body>
</html>